package com.study.model.mdao;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.alibaba.fastjson.JSONObject;
import com.study.model.pojo.Purchase;

@Mapper
public interface PurchaseMapper {

	/**
	 * 根据订单查询详单
	 * @param schno
	 * @return
	 */
	List<JSONObject> findBySchno(int schno);
	
	/**
	 * 根据详情单id查询
	 * @param purid
	 * @return
	 */
	Purchase findByPurid(int purid);
	
	/**
	 * 根据对应的采购单号删除对应的详单
	 * @param schno
	 * @return
	 */
	int deletepurchase(int schno);
	
	/**
	 * 新增一条采购单计划明细
	 * @param schno
	 * @param purdate
	 * @param gid
	 * @param purnum
	 * @param yesnum
	 * @param nonum
	 * @param purprice
	 * @param pdtime
	 * @param remark
	 * @return
	 */
	int insert(@Param("schno") Integer schno,@Param("purdate")Date purdate,@Param("gid")Integer gid,
			@Param("purnum")Integer purnum,@Param("nonum")Integer nonum,@Param("purprice")Double purprice,@Param("price")BigDecimal price);
	
	/**
	 * 条件查询采购明细
	 * @param input
	 * @return
	 */
	List<JSONObject> selectByWhere(@Param("input")String input,@Param("use_id")int use_id);
	
	
}
